using Acme.BookStore;
using Acme.BookStore.Dtos;
using AutoMapper;

namespace Acme.BookStore
{
    public class BookStoreApplicationAutoMapperProfile : Profile
    {
        public BookStoreApplicationAutoMapperProfile()
        {
            /* You can configure your AutoMapper mapping configuration here.
             * Alternatively, you can split your mapping configurations
             * into multiple profile classes for a better organization. */
            
            CreateMap<Book, BookDto>();
            
            CreateMap<CreateUpdateBookDto, Book>();

            CreateMap<News, NewsDto>();
            CreateMap<CreateNewsDto, News>(MemberList.Source);
            CreateMap<UpdateNewsDto, News>(MemberList.Source);
        }
    }
}
